package com.css.apps.base.user.action;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.css.util.Ajax;
import com.css.util.Messages;
import com.css.webbase.webwork.action.UserAction;
import com.opensymphony.xwork.Action;

@SuppressWarnings("serial")
public class FirstPage extends UserAction {
	private static Log log = LogFactory.getLog(FirstPage.class);
	private String dbCounts="0";
	private String cbCounts="0";
	private boolean chkApplyFlag = false;  // 门户的应用人员权限

	public FirstPage(){
		
	}
	@Override
	protected String userGo() {
		
		try {	
			/*List<String> roleIdlist =UserProvider.getRoleIdList(sUser.getUserId());
			if(roleIdlist!=null && roleIdlist.size()>0){
				 chkApplyFlag = (sUser.getFunctions().contains(PortalConstant.PORATL_APPLY_FUNCID))||(sUser.getFunctions().contains(PortalConstant.PORATL_ADMIN_FUNCID))||(sUser.getFunctions().contains(PortalConstant.PORATL_VIEW_FUNCID));
			}*/
		   /* dbCounts = com.css.apps.oa.work.service.DbCountsService.getDbWorkCounts(UserProvider.currentUser());
			cbCounts = com.css.apps.oa.urgency.service.DragUrgencyNumService.getDraUrgencyNum(UserProvider.currentUser());*/
			result = Ajax.JSONResult(0, dbCounts+","+cbCounts);
			return Action.SUCCESS;
		} catch (Exception ex) {
			String msg=Messages.getString("systemMsg.exception");
			log.error(msg, ex);
			setMessage(msg);
			dbCounts = "0";
			cbCounts = "0";
			result = Ajax.JSONResult(0, dbCounts+","+cbCounts);
			return Action.ERROR;
		}
	}
	public String getDbCounts() {
		return dbCounts;
	}
	public void setDbCounts(String dbCounts) {
		this.dbCounts = dbCounts;
	}
	public String getCbCounts() {
		return cbCounts;
	}
	public void setCbCounts(String cbCounts) {
		this.cbCounts = cbCounts;
	}
	public boolean isChkApplyFlag() {
		return chkApplyFlag;
	}
	public void setChkApplyFlag(boolean chkApplyFlag) {
		this.chkApplyFlag = chkApplyFlag;
	}
	
	
}
